1 2 3 |
Nature: Bug fix / Workaround Applies to: Chaos Calmer 15.05 Replaces info from: http://hobbykeller.spdns.de/?p=561 |
The davfs2 package which ships with OpenWRT’s Chaos Calmer (15.05) version may not compile correctly when building the oWRT binaries. It is typical of the bug that the compilation process is interrupted with a message as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
webdav.c: In function 'dav_conv_from_utf_8': webdav.c:587:9: error: 'from_utf_8' undeclared (first use in this function) if (from_utf_8) ^ webdav.c:587:9: note: each undeclared identifier is reported only once for each function it appears in webdav.c:588:9: warning: implicit declaration of function 'convert' [-Wimplicit-function-declaration] convert(&new, from_utf_8); ^ webdav.c: In function 'dav_conv_to_utf_8': webdav.c:599:9: error: 'to_utf_8' undeclared (first use in this function) if (to_utf_8) ^ webdav.c: In function 'dav_conv_from_server_enc': webdav.c:611:9: error: 'from_server_enc' undeclared (first use in this function) if (from_server_enc) ^ webdav.c: In function 'dav_conv_to_server_enc': webdav.c:623:9: error: 'to_server_enc' undeclared (first use in this function) if (to_server_enc) ^ webdav.c: At top level: webdav.c:1273:19: error: unknown type name 'iconv_t' convert(char **s, iconv_t conv) ^ webdav.c: In function 'prop_result': webdav.c:1896:13: error: 'from_server_enc' undeclared (first use in this function) if (from_server_enc) ^ In file included from webdav.c:22:0: webdav.c: At top level: compat.h:51:15: warning: 'canonicalize_file_name' defined but not used [-Wunused-function] static char * canonicalize_file_name(const char *path) ^ webdav.c:1544:1: warning: 'log_writer' defined but not used [-Wunused-function] log_writer(void *cookie, const char *buffer, size_t size) ^ make[6]: *** [webdav.o] Error 1 make[6]: Leaving directory `/home/ilek/codelab/openwrt/build_dir/target-powerpc_8540_musl-1.1.14/davfs2-1.5.2/src' make[5]: *** [all-recursive] Error 1 make[5]: Leaving directory `/home/ilek/codelab/openwrt/build_dir/target-powerpc_8540_musl-1.1.14/davfs2-1.5.2' make[4]: *** [all] Error 2 make[4]: Leaving directory `/home/ilek/codelab/openwrt/build_dir/target-powerpc_8540_musl-1.1.14/davfs2-1.5.2' make[3]: *** [/home/ilek/codelab/openwrt/build_dir/target-powerpc_8540_musl-1.1.14/davfs2-1.5.2/.built] Error 2 make[3]: Leaving directory `/home/ilek/codelab/openwrt/feeds/packages/net/davfs2' make[2]: *** [package/feeds/packages/davfs2/compile] Error 2 make[2]: Leaving directory `/home/ilek/codelab/openwrt' make[1]: *** [/home/ilek/codelab/openwrt/staging_dir/target-powerpc_8540_musl-1.1.14/stamp/.package_compile] Error 2 make[1]: Leaving directory `/home/ilek/codelab/openwrt' make: *** [world] Error 2 |
There is a discussion on GitHub under the title “davfs2 – can use full language support – error build” which references another bug report titled “davfs2: fix inconsistency with HAVE_ICONV and HAVE_ICONV_H” which finally contains a bug fix.
Bug fix
To fix the bug, change feeds/packages/net/davfs/Makefile
as shown in the following patch:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
--- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ PKG_NAME:=davfs2 PKG_VERSION:=1.5.2 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/ @@ -23,7 +23,7 @@ SECTION:=net CATEGORY:=Network SUBMENU:=Filesystem - DEPENDS=+libneon +kmod-fuse +libfuse + DEPENDS=+libneon +kmod-fuse +libfuse $(ICONV_DEPENDS) TITLE:=Mount a WebDAV resource as a regular file system. URL:=http://savannah.nongnu.org/projects/davfs2/ MAINTAINER:=Federico Di Marco <fededim@gmail.com> |
Furthermore, another patch file must be added to the patches
subdirectory and saved as patches/001-replace-have-iconv-h-with-have-iconv.patch
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
--- a/src/webdav.c +++ b/src/webdav.c +@@ -25,7 +25,7 @@ + #ifdef HAVE_FCNTL_H + #include <fcntl.h> + #endif +-#ifdef HAVE_ICONV_H ++#ifdef HAVE_ICONV + #include <iconv.h> + #endif + #ifdef HAVE_LANGINFO_H +@@ -231,7 +231,7 @@ static int initialized; + Needed by ssl_verify() which may be called at any time. */ + static int have_terminal; + +-#ifdef HAVE_ICONV_H ++#ifdef HAVE_ICONV + /* Handle to convert character encoding from utf-8 to LC_CTYPE. + If NULL no conversion is done. */ + static iconv_t from_utf_8; +@@ -264,7 +264,7 @@ static char **cookie_list; + /* Private function prototypes and inline functions */ + /*==================================================*/ + +-#ifdef HAVE_ICONV_H ++#ifdef HAVE_ICONV + static void + convert(char **s, iconv_t conv); + #endif +@@ -337,7 +337,7 @@ dav_init_webdav(const dav_args *args) + if (args->neon_debug & ~NE_DBG_HTTPPLAIN) + syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Initializing webdav"); + +-#ifdef HAVE_ICONV_H ++#ifdef HAVE_ICONV + char *lc_charset = nl_langinfo(CODESET); + if (lc_charset && strcasecmp(lc_charset, "UTF-8") != 0) { + from_utf_8 = iconv_open(lc_charset, "UTF-8"); |
davfs2 update to version 1.5.4
While the basic patching procedure still applies for version 1.5.4, the patch file has to be slightly modified. You can download an updated version here.